<template>
	<view class="">
		<!--   -->
		<view class="item" @click="toDetail" v-for="(item,index) in list" :class="index%2==0?'ecpire':''">
			<view class="acea-row row-middle row-between top-info" v-if="canClose">
				<view>3天内更新</view>
				<view class="close">×</view>
			</view>
			<view class="acea-row row-middle row-between sell-goods">
				<view class="goods-img">
					<image src="" mode="" class="img"></image>
					<view class="tag line1" v-if="index%2==0">
						已失效
					</view>
					<view class="tag line1" v-else>
						好货上新
					</view>
					<view class="acea-row row-middle distance">
						<image src="@/static/images/location.png" mode=""></image>
						<text>距您1.4km</text>
					</view>
				</view>
				<view class="acea-row row-column-between goods-info">
					<view class="title line1">
						出售 | 自用餐桌椅 | 10套
					</view>
					<view class="acea-row row-middle">
						<view class="sell-price">
							售价<text>1200</text>元
						</view>
					</view>
					<view class="gold-coin">
						<image src="@/static/images/goldcoin_icon_gray.png" mode="" v-if="index%2==0"></image>
						<image src="@/static/images/goldcoin_icon.png" mode="" v-else></image>
						<view class="num">25800</view>
					</view>
					<view class="acea-row goods-tag">
						<view class="tag">关键词1</view>
						<view class="tag">关键词2</view>
						<view class="tag">7年老店</view>
						<view class="tag">关键词2</view>
						<view class="tag">关键词2</view>
					</view>
				</view>
			</view>

			<view class="acea-row row-middle row-between visit-box">
				<view class="visit-advtar-box">
					<view class="visit-advtar">
						<image src="@/static/images/f.png" mode="" v-for="(item,index) in visitInfo" :key="index"
							:style="{left: (30 * index) + 'rpx'}"></image>
					</view>
					<view class="visit-num">18288人浏览 已成功匹配12254人</view>
				</view>

				<view class="visit-l">
					<view class="visit-num">5866人咨询</view>
					<view class="visit-btn" @click="toConcat(item.contacts)">
						立即咨询
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		// 商铺专区列表项
		name: 'goldItem',
		props: {
			list: {
				type: Array,
				default: () => {
					return [1, 1, 1]
				}
			},
			type: {
				type: String,
				default: () => {
					return 'work'
				}
			},
			canClose: {
				type: Boolean,
				default: () => {
					return false
				}
			},
			detail: {
				type: Object,
				default: () => {
					return {}
				}
			},
			
		},
		data() {
			return {
				visitInfo: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
			}
		},
		methods: {
			toDetail() {
				// 招工详情
				if (this.type == 'work') {

				} else if (this.type == 'unused') {
					uni.navigateTo({
						url: '/pages/details/secondHand/secondHand'
					})
				}
			},
			toConcat(contact) {
				if (!contact || contact.length < 1) {
					this.$util.Tips({
						title: '暂未获取到联系人'
					})
					return;
				}

				getApp().globalData.into_singleChatRoom({
					phone:contact[0].contactPhone,
					contactId:contact[0].contactId,
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "index.scss";
</style>